app
.filter('trustAsHtml', ['$sce', function ($sce) {
    return function (text) {
        return $sce.trustAsHtml(text);
    };
}])
.filter('strRepeat',function(){
	return function ( text, count ) {
		var ret = '';
		for ( var i=0; i<count; i++ ) {
			ret += text;
		}
		return ret;
	};
})
.filter('WdatePicker',function(){
	return function ( date ) {
		return date.slice(0,10);
	};
})
.filter('levelRepeat',function(){
	return function ( text, count ) {
		var ret = '';
		for ( var i=0; i<count-1; i++ ) {
			ret += text;
		}
		return ret;
	};
})
.filter('levelClass',function(){
	return function ( level ) {
		switch (level) {
			case 1:
				return 'bg-danger';
			case 2:
				return 'bg-info';
			case 3:
				return 'bg-warning';
			default:
				return '';
		}
	};
});